package com.zrf.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zrf.gulimall.common.database.utils.PageUtils;
import com.zrf.gulimall.product.entity.AttrAttrgroupRelationEntity;

import java.util.List;
import java.util.Map;

/**
 * 属性&属性分组关联
 *
 * @author zrf
 * @email 120662332@qq.com
 * @date 2021-01-23 16:07:19
 */
public interface AttrAttrGroupRelationService extends IService<AttrAttrgroupRelationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 根据属性id集合批量查询
     * @param attrIdList 属性id集合
     * @return 结果集
     */
    List<AttrAttrgroupRelationEntity> queryByAttrIds(List<Long> attrIdList);

    /**
     * 根据属性id查询
     * @param attrId 属性id
     * @return 结果集
     */
    AttrAttrgroupRelationEntity queryByAttrId(Long attrId);

    /**
     * 根据分组id查询
     * @param attrGroupId 属性分组id
     * @return 结果集
     */
    List<AttrAttrgroupRelationEntity> queryByAttrGroupId(Long attrGroupId);

    /**
     * 根据属性分组id集合批量查询
     * @param attrGroupIdList 属性分组id结合
     * @return
     */
    List<AttrAttrgroupRelationEntity> queryByAttrGroupIds(List<Long> attrGroupIdList);

    /**
     * 根据属性id和属性组id修改
     * @param attrId 属性id
     * @param attrGroupId 属性组id
     */
    void updateByAttrId(Long attrId, Long attrGroupId);

    /**
     * 批量删除
     * @param relationEntities 删除的对象
     */
    void delete(List<AttrAttrgroupRelationEntity> relationEntities);
}

